<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
    <body>
        <ui:composition template="./templates/default.xhtml">         
            <ui:define name="content">
                <h:form binding="#{profileManagerBean.loadChangePassword}">

                    <p:panel header="Change Password" id="employeePanel">
                        <font class="fieldNote">*- Mandatory Field<br/><br/></font>
                        <p:messages/>
                        <table>
                            <tr>
                                <td>User ID:</td>
                                <td>  
                                    <font color="red"> 
                                        <b><h:outputText id ="userid" value="#{profileManagerBean.userId}"  /></b>  
                                    </font>
                                </td>
                            </tr>      
                            <tr>
                                <td>Old password:</td>
                                <td>  
                                    <p:password label ="Old password " required="true" id="oldPassword" minLength="8" requiredMessage="Old Password Required" value="#{profileManagerBean.userPassword}" feedback="false" validatorMessage="Old Password Must Have a Minimum of 8 Digits">               
                                        <f:validateLength minimum="8"/> 
                                    </p:password> 
                                    <font class="fieldNote">* Min. 8</font> 

                                </td>
                            </tr>      
                            <tr>
                                <td>New password:</td>
                                <td>  
                                    <p:password label ="New password " required="true" id="newPassword" minLength="8" requiredMessage="New Password Required" value="#{profileManagerBean.newUserPassword}" feedback="true" validatorMessage="New Password Must Have a Minimum of 8 Digits">               
                                        <f:validateLength minimum="8"/>
                                    </p:password>
                                    <font class="fieldNote">* Min. 8</font>

                                </td>
                            </tr>
                            <tr>
                                <td>Re-type new password:</td>
                                <td>  <p:password label ="Re-type new password " required="true" id="newPassword2" minLength="8" requiredMessage="Re-type Password Required" value="#{profileManagerBean.newUserPassword2}" feedback="false" validatorMessage="Re-type New Password Must Have a Minimum of 8 Digits">               
                                        <f:validateLength minimum="8"/>
                                    </p:password> 
                                    <font class="fieldNote">* Min. 8</font>

                                </td>
                            </tr>
                            <tr>
                                <td></td>
                                <td><p:commandButton id="btncpassword" value="Change Password" actionListener="#{profileManagerBean.changePassword}"  update="employeePanel" ajax="true" /></td>
                            </tr>
                        </table>
                        <br/><font color="red"> &nbsp; <h:outputText id ="status" value="#{profileManagerBean.status}"  /> </font>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                        <br/>
                    </p:panel>
                </h:form>
            </ui:define>        
        </ui:composition>
    </body>
</html>
